import storage from 'good-storage'
import {logout} from "@/api/login";

export function setInfo(userInfo) {
    storage.set('userInfo', userInfo)
}

export function getInfo() {
    return storage.get('userInfo')
}

export function removeInfo() {
    logout({}, resData => {});
    storage.remove('userInfo')
}

export function setLoginNo(no) {
    storage.set('no', no)
}

export function getLoginNo() {
    return storage.get('no')
}

export function setLoginPwd(pwd) {
    storage.set('pwd', pwd)
}

export function getLoginPwd() {
    return storage.get('pwd')
}

export function setTokenTime(tokenTime) {
    storage.set('tokenTime', tokenTime)
}

export function getTokenTime() {
    return storage.get('tokenTime')
}

export function removeTokenTime() {
    storage.remove('tokenTime')
}

export function getToken() {
    return storage.get('accessToken')
}

export function setToken(accessToken) {
    storage.set('accessToken', accessToken)
}

export function removeToken() {
    storage.remove('accessToken')
}

export function getMacAddress() {
    return storage.get('address')
}

export function setMacAddress(address) {
    storage.set('address', address)
}

export function removeMacAddress() {
    storage.remove('address')
}

export function getYarnList() {
    return storage.get('yarnList')
}

export function setYarnList(yarnList) {
    storage.set('yarnList', yarnList)
}

export function removeYarnList() {
    storage.remove('yarnList')
}
